lib/gpg: Add more specific OstreeGpgError codes
authorDan Nicholson <nicholson@endlessm.com>
Sat, 15 Jun 2019 14:56:44 +0000 (09:56 -0500)
committerDan Nicholson <nicholson@endlessm.com>
Fri, 24 Jan 2020 20:02:17 +0000 (13:02 -0700)
commit0fbfc0b2079f32b919ae6b804bda40332e03b618
treeb1d4eb254f500dcbd14a948b6b231748e1f6363d
parent2c24f28ce45fe9c416650f004e30bcb97c76e0f0
lib/gpg: Add more specific OstreeGpgError codes

Currently `ostree_gpg_verify_result_require_valid_signature` always
returns an error that the key used for the signature is missing from the
keyring. However, all that's been determined is that there are no valid
signatures. The error could also be from an expired signature, an
expired key, a revoked key or an invalid signature.

Provide values for these missing errors and return them from
`ostree_gpg_verify_result_require_valid_signature`. The description of
each result is appended to the error message, but since the result can
contain more than one signature but only a single error can be returned,
the status of the last signature is used for the error code. See the
comment for rationale.

Related: flatpak/flatpak#1450
src/libostree/ostree-gpg-verify-result.c
src/libostree/ostree-gpg-verify-result.h
tests/test-pull-summary-sigs.sh
tests/test-remote-gpg-import.sh